package com.xiaoqi.store.entity;

import com.xiaoqi.store.controller.BaseController;

import java.util.Date;
import java.util.Objects;

/**
 * @Author Rookie Coder
 * @Description 订单模板类
 * @Date
 **/
public class OrderEntity extends BaseEntity {

   private Integer oid  ;// '订单id',
   private Integer uid  ;//'用户id',
   private String recv_name ;// '收货人姓名',
   private String  recv_phone ;// '收货人电话',
   private String recv_province ;// '收货人所在省',
   private String recv_city ;// '收货人所在市',
    private String recv_area ;// '收货人所在区',
    private String recv_address;// '收货详细地址',
    private Long total_price;// '总价',
    private Integer status ;// '状态：0-未支付，1-已支付，2-已取消，3-已关闭，4-已完成',
    private Date order_time;// '下单时间',
    private Date pay_time;// '支付时间',


    public OrderEntity() {
    }

    public OrderEntity(String createdUser, Date createdTime, String modifiedUser, Date modifiedTime, Integer oid, Integer uid, String recv_name, String recv_phone, String recv_province, String recv_city, String recv_area, String recv_address, Long total_price, Integer status, Date order_time, Date pay_time, String created_user, Date created_time, String modified_user, Date modified_time) {
        super(createdUser, createdTime, modifiedUser, modifiedTime);
        this.oid = oid;
        this.uid = uid;
        this.recv_name = recv_name;
        this.recv_phone = recv_phone;
        this.recv_province = recv_province;
        this.recv_city = recv_city;
        this.recv_area = recv_area;
        this.recv_address = recv_address;
        this.total_price = total_price;
        this.status = status;
        this.order_time = order_time;
        this.pay_time = pay_time;

    }

    public OrderEntity(Integer oid, Integer uid, String recv_name, String recv_phone, String recv_province, String recv_city, String recv_area, String recv_address, Long total_price, Integer status, Date order_time, Date pay_time, String created_user, Date created_time, String modified_user, Date modified_time) {
        this.oid = oid;
        this.uid = uid;
        this.recv_name = recv_name;
        this.recv_phone = recv_phone;
        this.recv_province = recv_province;
        this.recv_city = recv_city;
        this.recv_area = recv_area;
        this.recv_address = recv_address;
        this.total_price = total_price;
        this.status = status;
        this.order_time = order_time;
        this.pay_time = pay_time;

    }

    public Integer getOid() {
        return oid;
    }

    public void setOid(Integer oid) {
        this.oid = oid;
    }

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getRecv_name() {
        return recv_name;
    }

    public void setRecv_name(String recv_name) {
        this.recv_name = recv_name;
    }

    public String getRecv_phone() {
        return recv_phone;
    }

    public void setRecv_phone(String recv_phone) {
        this.recv_phone = recv_phone;
    }

    public String getRecv_province() {
        return recv_province;
    }

    public void setRecv_province(String recv_province) {
        this.recv_province = recv_province;
    }

    public String getRecv_city() {
        return recv_city;
    }

    public void setRecv_city(String recv_city) {
        this.recv_city = recv_city;
    }

    public String getRecv_area() {
        return recv_area;
    }

    public void setRecv_area(String recv_area) {
        this.recv_area = recv_area;
    }

    public String getRecv_address() {
        return recv_address;
    }

    public void setRecv_address(String recv_address) {
        this.recv_address = recv_address;
    }

    public Long getTotal_price() {
        return total_price;
    }

    public void setTotal_price(Long total_price) {
        this.total_price = total_price;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getOrder_time() {
        return order_time;
    }

    public void setOrder_time(Date order_time) {
        this.order_time = order_time;
    }

    public Date getPay_time() {
        return pay_time;
    }

    public void setPay_time(Date pay_time) {
        this.pay_time = pay_time;
    }





    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof OrderEntity)) return false;
        if (!super.equals(o)) return false;
        OrderEntity that = (OrderEntity) o;
        return Objects.equals(getOid(), that.getOid()) &&
                Objects.equals(getUid(), that.getUid()) &&
                Objects.equals(getRecv_name(), that.getRecv_name()) &&
                Objects.equals(getRecv_phone(), that.getRecv_phone()) &&
                Objects.equals(getRecv_province(), that.getRecv_province()) &&
                Objects.equals(getRecv_city(), that.getRecv_city()) &&
                Objects.equals(getRecv_area(), that.getRecv_area()) &&
                Objects.equals(getRecv_address(), that.getRecv_address()) &&
                Objects.equals(getTotal_price(), that.getTotal_price()) &&
                Objects.equals(getStatus(), that.getStatus()) &&
                Objects.equals(getOrder_time(), that.getOrder_time()) &&
                Objects.equals(getPay_time(), that.getPay_time());
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), getOid(), getUid(), getRecv_name(), getRecv_phone(), getRecv_province(), getRecv_city(), getRecv_area(), getRecv_address(), getTotal_price(), getStatus(), getOrder_time(), getPay_time());
    }

    @Override
    public String toString() {
        return "OrderEntity{" +
                "oid=" + oid +
                ", uid=" + uid +
                ", recv_name='" + recv_name + '\'' +
                ", recv_phone='" + recv_phone + '\'' +
                ", recv_province='" + recv_province + '\'' +
                ", recv_city='" + recv_city + '\'' +
                ", recv_area='" + recv_area + '\'' +
                ", recv_address='" + recv_address + '\'' +
                ", total_price=" + total_price +
                ", status=" + status +
                ", order_time=" + order_time +
                ", pay_time=" + pay_time +
                '}';
    }
}
